<!DOCTYPE html>
<html lang="zh-CN" style="height: 100%">

<head>
  <meta charset="utf-8">
</head>

<body style="height: 100%; margin: 0">

  <div id="part_weight_detail_chart" style="height: 60%; width: 80%;float: left;"></div>


  <script type="text/javascript" src="./js/echarts.min.js"></script>
  <script type="text/javascript" src="./js/entire-car.js"></script>
  <script type="text/javascript" src="./js/utils.js"></script>

  <script type="text/javascript">
    function updateUI(carType,partName,record,standard){
  
      let partWeightDetailChart = echarts.init(document.querySelector('#part_weight_detail_chart'));
  
      let bottom = 0.9*standard.lowLimit;
      let top = 1.1*standard.topLimit;
      
      partWeightDetailChartOption = getLinePlotOption(
        `${carType}车型${partName}零件重量监测记录`, "重量Kg", record.X, record.Y,
        bottom,top,standard.lowLimit,standard.topLimit);
      
      partWeightDetailChart.setOption(partWeightDetailChartOption);
      
    }
    
    window.onload = ()=>{
      //获取零件参数信息
      /**
       * 获取跳转参数
       *let partNumber =  new URLSearchParams(window.location.search).get('pn');
       */

      let carType = 'N350PPS';
      let partName = "前上防撞杆";
      let record = {
        X:['2023-10','2023-11','2023-12','2024-01','2024-02','2024-03','2024-04'],
        Y:[5.65,5.60,5.70,5.54,5.32,5.48,5.66]
      };
      let standard = {lowLimit:5.4,topLimit:6.0};
      //更新界面信息
      updateUI(carType,partName,record,standard);
    }
  </script>
</body>

</html>